package com.me.waterphase.listener.contact;

import com.me.waterphase.WaterPlayer.FACING;
import com.me.waterphase.utils.PhysicManager;
import com.me.waterphase.utils.PhysicManager.CONTACT_TYPE;

public class EdgeContact implements ICustomContact {

	private int numberContact;
	
	private boolean isUpper;
	private FACING facing; 
	
	public EdgeContact()
	{
		numberContact = 0;
		isUpper = false;
		facing = FACING.RIGHT;
	}
	
	public EdgeContact(int _numberContact, boolean _isUpper, FACING _facing)
	{
		numberContact = _numberContact;
		isUpper = _isUpper;
		facing = _facing;
	}
	
	@Override
	public CONTACT_TYPE getContactType() {
		return PhysicManager.CONTACT_TYPE.USERDATA_EDGE_SENSOR;
	}

	public FACING getFacing()
	{
		return facing;
	}
	
	public void setFacing(FACING _facing)
	{
		facing = _facing;
	}
	
	public int getNumberContact()
	{
		return numberContact;
	}
	
	public void setNumberContact(int _numberContact)
	{
		numberContact = _numberContact;
	}
	
	public boolean isUpper()
	{
		return isUpper;
	}
	
	public void setUpperFlag(boolean _isUpper)
	{
		isUpper = _isUpper;
	}
	
	public void increment()
	{
		numberContact++;
	}
	
	public void decrement()
	{
		if(numberContact > 0)
			numberContact--;
	}
}
